<?
  		 require_once(__DIR__ . '/../inc/Orders.php');
        $row = GetOrderDetail($_REQUEST['id']);
		$result1= array();
		$del = array();
        if(isset($_POST['del']))
        {
				$row = GetOrderDetail($_REQUEST['id']);
                $del = Delete($row);
                if($del === true)
                {
                        header("Location: index.php");
                        die();
                }
        } else{
       			$row = GetOrderDetail($_REQUEST['id']);
        }
?>
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <title>Delition of Order Information</title>
    <link rel="stylesheet" type="text/css" href="../inc/bootstrap.css">
    <style type="text/css" ">
        .error { color: red; }
    </style>
</head>

<body>
        <? include('../inc/header.php'); ?>
        <div class="container">
                        <? include('../inc/nav.php'); ?>
            <div id="contents">
                <dl class="error">
               		 <? foreach ($result1 as $key => $value): ?>
                     	<dt><?=$key?></dt>
                        <dd><?=$value?></dd>
                     <? endforeach; ?>
                </dl>
				 <table class="table table-striped table-bordered table-condensed table-hover">
                	<tr>
						<th>Order Information Delition Confirmation</th>                        
                    </tr>
					</table>
               <table class="table table-striped table-bordered table-condensed table-hover">
                    <tr>
						<th>Id Number</th>
                        <th>Customer ID</th>
                        <th>Payment Method ID</th>
                        <th>Shipping Method ID</th>		
						<th>Shipping Date</th>
                        <th>ETA</th>
                        <th>Shipping Cost</th>		       			
                    </tr>
                    <tr>
						<td><?=$row['id']?></td>
					    <td><?=$row['Customers_id']?></td>
                        <td><?=$row['PaymentMethods_id']?></td>
                        <td><?=$row['ShippingMethods_id']?></td>
						<td><?=$row['ShippingDate']?></td>
					    <td><?=$row['ETA']?></td>
                        <td><?=$row['ShippingCost']?></td>
                     </tr>
				</table>
				<table class="table table-striped table-bordered table-condensed table-hover">
                    <tr>
						<th>Sales Tax</th>
						<th>Final Cost</th>
                        <th>Payment Date</th>
                        <th>Payment</th>
                        <th>Status</th>	
						<th>created_at</th>
                        <th>update_at</th>			       			
                    </tr>
                    <tr>
                        <td><?=$row['SalesTax']?></td>
						<td><?=$row['FinalCost']?></td>
					    <td><?=$row['PaymentDate']?></td>
                        <td><?=$row['Payment']?></td>
                        <td><?=$row['Status']?></td>
						<td><?=$row['created_at']?></td>
                        <td><?=$row['updated_at']?></td>
                     </tr>
				</table>
                <form class="form-horizontal" method="post" action="">
                     <input class="btn btn-primary" type="submit" value="Delete Order Information?" name="del" />
                </form>
           </div>
       </div>
</body>
</html>
